package domain.entities;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * LaboratoryCertification entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "laboratory_certification", catalog = "bms")
public class LaboratoryCertification implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date dated;
	private Date expirationDate;
	private String labName;
	private String licensingBody;

	// Constructors

	/** default constructor */
	public LaboratoryCertification() {
	}

	/** minimal constructor */
	public LaboratoryCertification(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public LaboratoryCertification(ProtocoloCentro protocoloCentro, Date dated,
			Date expirationDate, String labName, String licensingBody) {
		this.protocoloCentro = protocoloCentro;
		this.dated = dated;
		this.expirationDate = expirationDate;
		this.labName = labName;
		this.licensingBody = licensingBody;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dated", length = 10)
	public Date getDated() {
		return this.dated;
	}

	public void setDated(Date dated) {
		this.dated = dated;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "expirationDate", length = 10)
	public Date getExpirationDate() {
		return this.expirationDate;
	}

	public void setExpirationDate(Date expirationDate) {
		this.expirationDate = expirationDate;
	}

	@Column(name = "labName")
	public String getLabName() {
		return this.labName;
	}

	public void setLabName(String labName) {
		this.labName = labName;
	}

	@Column(name = "licensingBody")
	public String getLicensingBody() {
		return this.licensingBody;
	}

	public void setLicensingBody(String licensingBody) {
		this.licensingBody = licensingBody;
	}

}